package lanqiao;

import java.util.Scanner;

public class flower {
    public static void main(String[] args) {
        int[] arr = {9,11,1,12,5,8,9,10,6};
        Scanner scanner = new Scanner(System.in);
        int money = scanner.nextInt();
        StringBuffer stringBuffer = new StringBuffer();
        int min = Integer.MAX_VALUE;
        int minIndex = -1;
        int mod = 0;
        int nums = 0;
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] <= min){
                min = arr[i];
                minIndex = i+1;
            }
        }
        mod = money % min;
        nums = money / min;
        if (nums <= 0){
            System.out.println(-1);
        }

        int head = minIndex;
        while (nums>=1){
            head = minIndex;
            if (mod>0){
                for (int i = minIndex; i <arr.length ; i++) {
                    if (arr[i]<=min){
                        head = Math.max(head,i+1);
                    }
                }
            }
            stringBuffer.append(head);
            nums--;
            mod-=(arr[head-1]-arr[minIndex-1]);
        }
        System.out.println(stringBuffer.toString());
    }
}
